/*
    Mango - Open Source M2M - http://mango.serotoninsoftware.com
    Copyright (C) 2006-2011 Serotonin Software Technologies Inc.
    @author Matthew Lohbihler
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.serotonin.mango.rt.dataSource.onewire;

import com.dalsemi.onewire.utils.Address;
import com.serotonin.mango.rt.dataSource.PointLocatorRT;
import com.serotonin.mango.vo.dataSource.onewire.OneWirePointLocatorVO;

/**
 * @author Matthew Lohbihler
 */
public class OneWirePointLocatorRT extends PointLocatorRT {
    private final OneWirePointLocatorVO vo;
    private final Long address;

    public OneWirePointLocatorRT(OneWirePointLocatorVO vo) {
        this.vo = vo;
        address = Address.toLong(vo.getAddress());
    }

    @Override
    public boolean isSettable() {
        return vo.isSettable();
    }

    public Long getAddress() {
        return address;
    }

    public OneWirePointLocatorVO getVo() {
        return vo;
    }
}
